package com.zmn.mcc.dubbo.interfaces.permit;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.mcc.common.dto.cc.CCDeptDpermitDRO;
import com.zmn.mcc.common.dto.cc.CCPermitDRO;
import com.zmn.mcc.common.dto.cc.UpdateQuery;
import com.zmn.mcc.common.dto.permit.PermitDRO;
import com.zmn.mcc.common.dto.permit.PermitTreeDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 描述: 权限查询接口
 *
 * @author guoqiao
 * @since 2021/5/8 10:41
 */
@Api(value = "权限查询服务", tags = {"权限查询"})
public interface PermitListRemoteService {

    /**
     * 根据更新时间获取权限数据
     *
     * @param query
     * @return ResponseDTO<List < CCBaseAreaDro>>
     */
    @ApiOperation(value = "根据更新时间获取权限数据", response = ResponseDTO.class)
    ResponseDTO<List<CCPermitDRO>> listPermitByUpdateTime(@ApiParam(value = "查询条件", required = false) UpdateQuery query);

    /**
     * 根据更新时间获取部门数据权限
     *
     * @param pageSize  每页条数
     * @param pageIndex 页码
     * @return ResponseDTO<List < CCDeptDpermitDRO>>
     */
    @ApiOperation(value = "根据更新时间获取部门数据权限", response = ResponseDTO.class)
    ResponseDTO<List<CCDeptDpermitDRO>> listDeptPermitByUpdateTime(@ApiParam(value = "每页条数", required = false)
                                                                   @NotNull(message = "每页条数不能为空") Integer pageSize,
                                                                   @ApiParam(value = "页码", required = false)
                                                                   @NotNull(message = "页码不能为空") Integer pageIndex);


    /**
     * 描述: 根据员工ID和组织结构ID查询员工部门权限
     *
     * @param staffId staffId
     * @return com.zmn.common.dto2.ResponseDTO<java.util.List < com.zmn.mcc.common.dto.cc.CCStaffDpermitDRO>>
     * @author jiafei
     * @since 2022/5/24 11:14
     */
    ResponseDTO<List<PermitDRO>> listOrgPermitByStaffId(@ApiParam(value = "员工id")
                                                        @NotNull(message = "员工id不能为空") Integer staffId);

    /**
     * 描述: 根据员工ID和组织结构ID查询员工部门权限
     *
     * @param staffId staffId
     * @return com.zmn.common.dto2.ResponseDTO<java.util.List < com.zmn.mcc.common.dto.cc.CCStaffDpermitDRO>>
     * @author jiafei
     * @since 2022/5/24 11:14
     */
    @ApiOperation(value = "根据员工ID和组织结构ID查询员工部门权限", response = ResponseDTO.class)
    ResponseDTO<List<PermitTreeDRO>> listProductPermitByStaffId(@ApiParam(value = "员工id")
                                                                @NotNull(message = "员工id不能为空") Integer staffId);

    
    /**
     * 描述: 校验用户是否拥有权限
     *
     *
     * @param app app
     * @param urls urls 
     * @return com.zmn.common.dto2.ResponseDTO<java.util.List < java.lang.String>>
     * @author jiafei
     * @since 2022/8/4 14:15  
     */
    ResponseDTO<List<String>> checkPermitUrls(@ApiParam(value = "系统名称")
                                              @NotNull(message = "系统名称不能为空") String app, @ApiParam(value = "员工id")
                                              @Size(message = "权限urls", min = 1, max = 100) List<String> urls);
}
